var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { jsx as _jsx } from "react/jsx-runtime";
import { PureComponent } from "react";
import { Toast } from "devextreme-react/toast";
function DevDefaultToast(WrappedComponent) {
    return class extends PureComponent {
        static Style;
        state = {
            Visible: false,
            message: "",
            type: "info",
        };
        show = (params) => {
            this.setState({
                Visible: true,
                message: params.message,
                type: params.type,
            });
        };
        onHiding() {
            this.setState({
                Visible: false,
            });
        }
        render() {
            return (_jsx(WrappedComponent, { ...this.props, visible: this.state.Visible, message: this.state.message, type: this.state.type, onHiding: this.onHiding.bind(this), displayTime: 2000 }));
        }
    };
}
/**
 * ## 基于DevExpress DevToast进行的二次封装组件
 * ~~~js
 * import DevNotify  from 'sright-ui'
 * ~~~
 * [DevNotify连接](https://js.devexpress.com/Documentation/ApiReference/UI_Components/dxToast/?search=Toast)
 *
 * ### 介绍
 * 1. <DevDefaultNotify.Style/> :
 *   1.1、封装修改默认样式，提供全局提示通用功能的基础组件。
 *   1.2、该组件通过 ref 进行调用和传递参数,具体使用参考案例。
 *   1.3、参数为  type: "类型", message: "内容",
 */
export class DevNotify extends PureComponent {
    static Style;
}
// 默认 全局提示
let DevDefaultNotify = class DevDefaultNotify extends PureComponent {
    render() {
        return _jsx(Toast, { ...this.props });
    }
};
DevDefaultNotify = __decorate([
    DevDefaultToast
], DevDefaultNotify);
export { DevDefaultNotify };
export default DevNotify;
